//
//  WePersonalInfoControl.m
//  WeGalaxy
//
//  Created by Zheng on 2017/7/6.
//  Copyright © 2017年 Zheng. All rights reserved.
//

#import "WePersonalInfoControl.h"

@implementation WePersonalInfoControl

#pragma mrak - 初始化
- (instancetype)init {
    self = [super init];
    if (self) {
        [self subviewInView];
    }
    return self;
}

#pragma mark - 子视图
- (void)subviewInView {
    [self addSubview:self.numbersLbl];
    [self addSubview:self.titleLbl];
    [self addSubview:self.redView];
    
    [_numbersLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(self);
        make.centerY.equalTo(self).multipliedBy(0.75);
    }];
    
    [_titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(self);
        make.centerY.equalTo(self).multipliedBy(1.6);
    }];
    
    [_redView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_numbersLbl).offset(-7);
        make.width.height.mas_equalTo(8);
        make.right.mas_equalTo(-10);
    }];
}

- (UILabel *)numbersLbl {
    if (!_numbersLbl) {
        _numbersLbl = [UILabel new];
        _numbersLbl.text = @"0";
        _numbersLbl.font = kCX_FONT(14);
        _numbersLbl.textAlignment = NSTextAlignmentCenter;
    }
    return _numbersLbl;
}

- (UILabel *)titleLbl {
    if (!_titleLbl) {
        _titleLbl = [UILabel new];
        _titleLbl.font = kCX_FONT(14);
        _titleLbl.textColor = [UIColor grayColor];
        _titleLbl.textAlignment = NSTextAlignmentCenter;
        _titleLbl.text = @"粉丝数";
    }
    return _titleLbl;
}

- (UIView *)redView {
    if (!_redView) {
        _redView = [UIView new];
        _redView.backgroundColor = kRGB_COLOR(245, 64, 53, 1);
        kCX_RADIUS(_redView, 4, 0);
    }
    return _redView;
}




@end
